﻿using UnityEditor;
using UnityEngine;

namespace EditorFramework
{
    [CustomEditorWindow(2)]
    public class GUIBaseExample : EditorWindow
    {
        public class Label : GUIBase
        {
            private string mText = "Label";

            public Label(string text)
            {
                mText = text;
            }
            
            public override void OnGUI(Rect position)
            {
                GUILayout.Label(mText);
            }
            protected override void OnDispose()
            {
                mText = null;
            }
        }

        private Label mLabel = new Label("123");
        private Label mLabel2 = new Label("456");
        
        private void OnGUI()
        {
            mLabel.OnGUI(Rect.zero);
            mLabel2.OnGUI(Rect.zero);
        }
    }
}